<template>
  <div id="zhishi-index">
    <div
      v-if="roles === 'teacher'"
      class="one-btns"
    >
      <div
        class="all-btn"
        @click="$router.push('/zhishi/gengxin')"
      >
        <el-icon>
          <Tools />
        </el-icon>
        更新知识图谱
      </div>
    </div>
    <HomeChart2 />
  </div>
</template>
    
    <script>
import HomeChart2 from "@/components/HomeChart2.vue";
export default {
  components: {
    HomeChart2,
  },
  name: "ZhishiIndex",
  data() {
    return {
      roles: "",
    };
  },
  created() {
    this.roles = JSON.parse(localStorage.getItem("userInfo")).roles[0];
  },
  methods: {},
};
</script>
  <style lang="scss" scoped>
#zhishi-index {
  margin-bottom: 20px;
  .all-box {
    padding: 20px;
    box-sizing: border-box;
  }
  .one-btns {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
  }
}
</style>